using NHibernate.Validator.Constraints;
using SharpArch.Core.PersistenceSupport;
using SharpArch.Core.DomainModel;
using System;

namespace gnodotnet.Core.MailingList
{
    public class Message : Entity
    {
        public Message() { }
		
		[DomainSignature]
		[NotNull, NotEmpty]
		public virtual string Subject { get; set; }

		[DomainSignature]
		[NotNull]
		public virtual string Contents { get; set; }

		[DomainSignature]
		public virtual DateTime? SentOn { get; private set; }
        public virtual void Send(DateTime now, IMessanger messanger) {
            messanger.Deliver(this);
            SentOn = now;
        }
    }
}
